
package com.elong.common.service;

import java.util.HashMap;
import java.util.Map;

import com.elong.common.http.FluentHttpUtil;
import com.elong.common.http.HttpResult;



/**
 * @ClassName: RenRenLogin

 * @Description: 登陆人人网

 * @author Guanguo.Gao

 * @date 2014年9月16日 下午2:53:52

 * @version V1.0
 */
public class RenRenLogin {

    public static void main(String[] args) {
        String renrenLoginUrl = "http://www.renren.com/ajaxLogin/login";
        Map<String, String> params = new HashMap<String, String>();
        params.put("email", "657364199@qq.com");
        params.put("icode", "");
        params.put("origURL", "http://www.renren.com/home");
        params.put("domin", "renren.com");
        params.put("key_id", "1");
        params.put("captcha_type", "web_login");
        params.put("password", "a3729291988");
        params.put("rkey", "4b386eddf6a2bbc4c050788aabf08d7b");
        FluentHttpUtil api = FluentHttpUtil.getInstance();
        HttpResult result = api.URLPost(renrenLoginUrl, params);
        if(result.getRetCode() == 200){
            String otherUrl = result.getRedirectUrl();
            if(otherUrl.equals(""))
                 otherUrl = "http://www.renren.com/234054427#notice";
            System.out.println(otherUrl);
            HttpResult otherResult = api.URLGet(otherUrl, null);
            System.out.println(otherResult.getRetContent());
        }
    }
}
